<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<%@include file="/WEB-INF/webpage/common/taglibs.jspf" %>
<!DOCTYPE html>
<html>
<head>
    <meta charset="utf-8">
    <title><spring:message code="sys.site.title"
                           arguments="${platformName}"/></title>
    <meta name="decorator" content="list"/>
    <!-- 启用360浏览器的极速模式(webkit) -->
    <meta name="renderer" content="webkit">
    <!-- 避免IE使用兼容模式 -->
    <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
    <link rel="stylesheet/less" type="text/css"
          href="${staticPath}/login/css/com.less?v=<%=System.currentTimeMillis()%>"/>
    <script src="${staticPath}/login/js/less.min.js" type="text/javascript"
            charset="utf-8"></script>
    <script type="text/javascript"
            src="${staticPath}/vendors/layer/layer.min.js"></script>
    <style>
        * {
            font-family: "microsoft yahei";
        }

        body {
            overflow: hidden;
        }
    </style>
</head>
<body style="overflow: hidden">
<script type="text/javascript"
        src="${staticPath}/vendors/socketio/socket.io.js"></script>
<script
        src="//cdn.bootcss.com/jquery-cookie/1.4.1/jquery.cookie.min.js"></script>
<script src="${staticPath}/common/js/window.js" type="text/javascript"
        charset="utf-8"></script>
<script type="text/javascript">
    $(document).ready(function () {
        //设置1秒调用一次show_cur_times函数
        // setInterval("showTimes()",100);
        var changePwdTimes = 0;//"${fns:getUser().changePwdTimes}"
        if (confirm("${error}")) { //只有当点击confirm框的确定时，该层才会关闭
            window.location.href = "${adminPath}/logout";
        }
        window.location.href = "${adminPath}/logout";
        return;
        //首次登录修改密码
        setTimeout(function () {
            if (changePwdTimes == 0) {
                layer.open({
                    type: 2,
                    area: ['650px', '300px'],
                    title: "弱密码修改密码",
                    maxmin: false, //开启最大化最小化按钮
                    content: '${adminPath}/sys/user/${fns:getUser().id}/changePassword',
                    btn: ['确定', '关闭(退出登录)'],
                    yes: function (index, layero) {
                        var body = top.layer.getChildFrame('body', index);
                        var iframeWin = layero.find('iframe')[0]; //得到iframe页的窗口对象，执行iframe页的方法：iframeWin.method();
                        //文档地址
                        //http://www.layui.com/doc/modules/layer.html#use
                        var loadIndex = iframeWin.contentWindow.getloadIndex();
                        iframeWin.contentWindow.doSubmit(
                            function (results) {
                                closeLoad(loadIndex);
                                top.layer.alert(results.msg, {icon: 0, title: '警告'});
                                if (results.ret == 0) {
                                    //判断逻辑并关闭
                                    setTimeout(function () {
                                        top.layer.close(index)
                                    }, 100);//延时0.1秒，对应360 7.1版本bug
                                    //window.location.reload();
                                    window.location.href = "${adminPath}/logout";
                                }
                            });
                    },
                    cancel: function (index, layero) {
                        if (confirm('弱密码需修改登录密码，否则将退出登录！确定要关闭么？')) { //只有当点击confirm框的确定时，该层才会关闭
                            window.location.href = "${adminPath}/logout";
                        }
                        return false;
                    }
                });
            }
        }, 500);

    });
</script>
</body>
</html>
